var app = getApp();

Page({
  data: {
    loadingBoo: !0,
    moreBoo: !0,
    categories: [{
        id: 1,
        name: '维生素'
      },
      {
        id: 2,
        name: '维生素'
      },
      {
        id: 3,
        name: '维生素'
      },
      {
        id: 4,
        name: '维生素'
      }
    ],
    proList: []
  },
  tapFun: function(t) {
    var that = this;
    var fid = t.target.dataset.fid
    app.util.request({
      'url': 'entry/wxapp/Allfenlgoods',
      data: {
        fid: fid
      },
      success: function (res) {
        console.log(res)
        that.setData({
          proList: res.data.flgoods,
          categories: res.data.fenli,
        })
      }
    })
  },
  onLoad: function(options) {
    var that = this;
    var fid = options.fid
    that.setData({
      fid: fid
    })
  },
  onReady: function() {
    this.getAllfenlgoods()
  },
  onShow: function() {},
  onHide: function() {},
  onUnload: function() {},
  onPullDownRefresh: function() {},
  onReachBottom: function() {},
  onShareAppMessage: function() {},
  getAllfenlgoods: function() {
    var that = this
    var fid = that.data.fid
    app.util.request({
      'url': 'entry/wxapp/Allfenlgoods',
      data: {
        fid: fid
      },
      success: function(res) {
        console.log(res)
        that.setData({
          proList: res.data.flgoods,
          categories: res.data.fenli,
        })
      }
    })
  }

});